<include file="public@header"/>
</head>
<body>
<div class="wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="">备份列表</a></li>
    </ul>
    <div class="well form-inline margin-top-20">
        数据备份: <button type="button" class="btn btn-danger do-backup">备份</button>
    </div>
    <table class="table table-hover table-bordered table-list">
        <thead>
        <tr>
            <th width="50">序号</th>
            <th width="200">备份</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <foreach name="list" item="vo" key="key">
            <tr>
                <td>{$key+1}</td>
                <td>{$vo}</td>
                <td>
                    <a href="{:url('system/import', ['source' => $vo])}">还原</a>
                    <a href="{:url('system/download', ['source' => $vo])}" download>下载</a>
                </td>
            </tr>
        </foreach>
        </tbody>
    </table>
    <div class="table-actions">
        <!--<button type="submit" class="btn btn-primary btn-sm js-ajax-submit">{:lang('SORT')}</button>-->
    </div>
    <ul class="pagination">{$page|default=''}</ul>
</div>
<script src="__STATIC__/js/admin.js"></script>
<script>
    $('.do-backup').click(function () {
        $(this).prop('disabled', true).html('备份中 ... ');
        var btn = $(this);
        $.post('{:url('system/dobackup')}', function (data) {
            btn.prop('disabled', false).html(data.msg);
            setTimeout(function () {
                location.reload();
            }, 3000);
        });
    });
</script>
</body>
</html>